<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    console.log(isNaN(123));//false
    console.log(isNaN('123'));//false
    console.log(isNaN('a'));//true
    console.log(isNaN(null));//false
    console.log(isNaN(undefined));//true

    console.log(Number(null)); //0
    console.log(Number('a'));
    console.log(Number(undefined));//NaN

    // var a = 1
    // function a(){
    //   
    // }
    // console.log(a);

    // function a(){
    //   console.log(2);
    // }
    // var a
    // a = 1
    // console.log(a);//1

    // function a(){alert(2)}
    // var a = null
    // console.log(a);//函数体       
    // a=1;   
    // console.log(a);//1      
    // console.log(a);//1       
    // a=3;
    // console.log(a);//3       
    // function a(){alert(3)}
    // console.log(a);//3
    // console.log(a());//3

    // var a
    // console.log(a);// 声明而不赋值undefined


    /*随机产生十六进制的颜色值*/
    // var i = 0;
    // var str = "#";
    // var random = 0;
    // var aryNum = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];

    // for(i = 0; i < 6; i++)
    // {
    // 	random = parseInt(Math.random() * 16);

    // 	str += aryNum[random];
    // }
    // alert(str);
    // console.log(str);


    function sum(a, b) {
      return function () {
        return function(){
          return a + b
        }
      }

    }
    console.log(sum(1, 2)()(), '----');//3

  </script>
</body>

</html>